package ru.ksu.ktk.diploma.sdi.mapping.learner;

import ru.ksu.ktk.diploma.sdi.mapping.Triple;

/**
 * Learning example of mapping element
 * 
 * @author coldflame 04.05.2009 19:58:06
 */
public class LearningExample extends Example {
    private static final String FORMATTED_VIEW_STRING = "<%s, %s> <--> %s";
    private Triple predictedProperty;

    public LearningExample(Triple firstTriple, Triple secondTriple, Triple predictedProperty) {
        super(firstTriple, secondTriple);
        this.predictedProperty = predictedProperty;
    }

    public Triple getPredictedProperty() {
        return predictedProperty;
    }

    public void setPredictedProperty(Triple predictedProperty) {
        this.predictedProperty = predictedProperty;
    }

    /*@Override
    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof LearningExample)) return false;
        LearningExample e = (LearningExample) o;
        return super.equals(e) && predictedProperty.equals(e.getPredictedProperty());
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        if (predictedProperty != null){
            result = 31 * result + predictedProperty.hashCode();
        }

        return result;

    }*/

    @Override
    public String toString() {
        return String.format(FORMATTED_VIEW_STRING, firstTriple.toString(), secondTriple.toString(), predictedProperty
            .getPathUri());
    }

}
